﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.oracle;

namespace SharpSqlAnalyzer.stmt.oracle
{
	// Token: 0x02000136 RID: 310
	public class TPlsqlCreatePackage : TCommonStoredProcedureSqlStatement
	{
		// Token: 0x170001D1 RID: 465
		// (get) Token: 0x06000A13 RID: 2579 RVA: 0x00304524 File Offset: 0x00302724
		// (set) Token: 0x06000A12 RID: 2578 RVA: 0x0030451B File Offset: 0x0030271B
		public virtual TInvokerRightsClause InvokerRightsClause
		{
			get
			{
				return this.invokerRightsClause;
			}
			set
			{
				this.invokerRightsClause = value;
			}
		}

		// Token: 0x170001D2 RID: 466
		// (get) Token: 0x06000A14 RID: 2580 RVA: 0x0030452C File Offset: 0x0030272C
		public override TObjectName StoredProcedureName
		{
			get
			{
				return this.packageName;
			}
		}

		// Token: 0x170001D3 RID: 467
		// (get) Token: 0x06000A15 RID: 2581 RVA: 0x00304534 File Offset: 0x00302734
		// (set) Token: 0x06000A16 RID: 2582 RVA: 0x0030453C File Offset: 0x0030273C
		public virtual int Kind
		{
			get
			{
				return this.kind;
			}
			set
			{
				this.kind = value;
			}
		}

		// Token: 0x06000A17 RID: 2583 RVA: 0x00304545 File Offset: 0x00302745
		public TPlsqlCreatePackage() : this(EDbVendor.dbvoracle)
		{
		}

		// Token: 0x06000A18 RID: 2584 RVA: 0x0030454F File Offset: 0x0030274F
		public TPlsqlCreatePackage(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstplsql_createpackage;
		}

		// Token: 0x06000A19 RID: 2585 RVA: 0x00304567 File Offset: 0x00302767
		internal override void buildsql()
		{
		}

		// Token: 0x06000A1A RID: 2586 RVA: 0x00304569 File Offset: 0x00302769
		internal override void clear()
		{
		}

		// Token: 0x06000A1B RID: 2587 RVA: 0x0030456B File Offset: 0x0030276B
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000A1C RID: 2588 RVA: 0x00304572 File Offset: 0x00302772
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06000A1D RID: 2589 RVA: 0x00304574 File Offset: 0x00302774
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			if (base.doParseStatement(psql) != 0)
			{
				return -1;
			}
			TCreatePackageSqlNode tcreatePackageSqlNode = (TCreatePackageSqlNode)this.rootNode;
			this.packageName = tcreatePackageSqlNode.PackageName;
			base.DatabaseObjects.Add(this.packageName);
			this.kind = tcreatePackageSqlNode.Kind;
			this.invokerRightsClause = tcreatePackageSqlNode.InvokerRightsClause;
			this.LabelName = tcreatePackageSqlNode.LabelName;
			this.EndLabelName = tcreatePackageSqlNode.EndLabelName;
			if (tcreatePackageSqlNode.Definitions_or_declarations != null)
			{
				tcreatePackageSqlNode.Definitions_or_declarations.doParse(this, ESqlClause.unknown);
				for (int i = 0; i < tcreatePackageSqlNode.Definitions_or_declarations.size(); i++)
				{
					this.DeclareStatements.add(tcreatePackageSqlNode.Definitions_or_declarations.getStatementSqlNode(i).Stmt);
				}
			}
			if (tcreatePackageSqlNode.Stmts != null)
			{
				tcreatePackageSqlNode.Stmts.doParse(this, ESqlClause.unknown);
				for (int j = 0; j < tcreatePackageSqlNode.Stmts.size(); j++)
				{
					this.BodyStatements.add(tcreatePackageSqlNode.Stmts.getStatementSqlNode(j).Stmt);
				}
			}
			if (tcreatePackageSqlNode.ExceptionClause != null)
			{
				tcreatePackageSqlNode.ExceptionClause.doParse(this, ESqlClause.unknown);
				this.ExceptionClause = tcreatePackageSqlNode.ExceptionClause;
			}
			return 0;
		}

		// Token: 0x170001D4 RID: 468
		// (get) Token: 0x06000A1F RID: 2591 RVA: 0x003046A8 File Offset: 0x003028A8
		// (set) Token: 0x06000A1E RID: 2590 RVA: 0x0030469F File Offset: 0x0030289F
		public virtual TObjectName PackageName
		{
			get
			{
				return this.packageName;
			}
			set
			{
				this.packageName = value;
			}
		}

		// Token: 0x06000A20 RID: 2592 RVA: 0x003046B0 File Offset: 0x003028B0
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000A21 RID: 2593 RVA: 0x003046C0 File Offset: 0x003028C0
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.ParameterDeclarations != null)
			{
				this.ParameterDeclarations.acceptChildren(v);
			}
			if (this.BodyStatements.size() > 0)
			{
				this.BodyStatements.acceptChildren(v);
			}
			if (this.ExceptionClause != null)
			{
				this.ExceptionClause.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x0400126F RID: 4719
		private TInvokerRightsClause invokerRightsClause;

		// Token: 0x04001270 RID: 4720
		private int kind = 1;

		// Token: 0x04001271 RID: 4721
		private TObjectName packageName;
	}
}
